<%@ page import="com.one.pojo.Cart" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: LJ
  Date: 2022/4/25
  Time: 23:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script>
    function goBuy(){
        location.href="buy.html";
    }
</script>
<body>
<table>
    <tr>
        <td>书名</td>
        <td>价格</td>
        <td>单价</td>
        <td>购买数量</td>
        <td>下单时间</td>
        <td>操作</td>
    </tr>
    <%
        List<Cart> list = (List<Cart>) (request.getAttribute("carts"));
        for (int i = 0; i < list.size(); i++) {
    %>
    <tr>
        <td><%=list.get(i).getName()%></td>
        <td><%=list.get(i).getPrice()%></td>
        <td><%=list.get(i).getPrice()%></td>
        <td><%=list.get(i).getNumber()%></td>
        <td><%=list.get(i).getData()%></td>
        <td><button onclick="goBuy()">付款</button></td>
    </tr>
    <%
        }
    %>
</table>
</body>
</html>
